package com.lzxzjy.pojo;

public class Reader {
    private Integer readerId;       // 读者编号
    private String readerName;      // 读者姓名
    private String readerSex;       // 读者性别
    private String readerPhone;       // 联系电话
    private String readerPassword;        // 密码
    private Double readerArrears;       // 欠费数
    private Integer readerState;    // 读者账号状态
    private String readerEmail;     // 读者邮箱


    // 构造函数
    public Reader() {
    }

    public Reader(Integer readerId, String readerName, String readerSex, String readerPhone, String readerPassword, Double readerArrears, Integer readerState, String readerEmail) {
        this.readerId = readerId;
        this.readerName = readerName;
        this.readerSex = readerSex;
        this.readerPhone = readerPhone;
        this.readerPassword = readerPassword;
        this.readerArrears = readerArrears;
        this.readerState = readerState;
        this.readerEmail = readerEmail;
    }

    // get 和 set 方法
    public Integer getReaderId() {
        return readerId;
    }

    public void setReaderId(Integer readerId) {
        this.readerId = readerId;
    }

    public String getReaderName() {
        return readerName;
    }

    public void setReaderName(String readerName) {
        this.readerName = readerName;
    }

    public String getReaderSex() {
        return readerSex;
    }

    public void setReaderSex(String readerSex) {
        this.readerSex = readerSex;
    }

    public String getReaderPhone() {
        return readerPhone;
    }

    public void setReaderPhone(String readerPhone) {
        this.readerPhone = readerPhone;
    }

    public String getReaderPassword() {
        return readerPassword;
    }

    public void setReaderPassword(String readerPassword) {
        this.readerPassword = readerPassword;
    }

    public Double getReaderArrears() {
        return readerArrears;
    }

    public void setReaderArrears(Double readerArrears) {
            this.readerArrears = readerArrears;
    }

    public Integer getReaderState() {
        return readerState;
    }

    public void setReaderState(Integer readerState) {
        this.readerState = readerState;
    }

    public String getReaderEmail() {
        return readerEmail;
    }

    public void setReaderEmail(String readerEmail) {
        this.readerEmail = readerEmail;
    }

    // 逻辑视图
    public String getReaderStateStr() {
        return this.readerState == 0 ? "禁用" : "启用";
    }

    @Override
    public String toString() {
        return "Reader{" +
                "readerId=" + readerId +
                ", readerName='" + readerName + '\'' +
                ", readerSex='" + readerSex + '\'' +
                ", readerPhone='" + readerPhone + '\'' +
                ", readerPassword='" + readerPassword + '\'' +
                ", readerArrears=" + readerArrears +
                ", readerState=" + readerState +
                ", readerEmail='" + readerEmail + '\'' +
                '}';
    }

    // 判空
    public boolean isEmpty() {
        return "".equals(this.readerName) && "".equals(this.readerSex) && "".equals(this.readerPhone) && "".equals(this.readerPassword) && "".equals(this.readerEmail);
    }
}
